/*

Author   : chaos

FileName : friend_class.cpp

Date     : 13/08/17 19:32:39

*/
#include <iostream>
#include <cstring>
using namespace std;

class Book
{
    private :
        char name [30];
        long index;
        bool on_shelf;
        friend class Librarian;

    public:
        void show_data();
};

void Book::show_data(){

    cout << " name : " << name;
    cout << " index : " << index;
    if(on_shelf == true)
        cout << " On shelf "  << endl;
    else
        cout << " Not on shelf " << endl;
}


class Librarian
{
    public:
        static void insert_book(const char * name , long index)
        {
            Book A_Book;

            A_Book.index = index;
            strcpy(A_Book.name , name);
            A_Book.on_shelf = true;

            A_Book.show_data();
        }
};
int main(int argc ,char *argv[])
{
    Librarian::insert_book("The C++ Bible",1);

    Librarian::insert_book("The C++ Holy Bible",2);

    return 0;
}
